package com.example.administrator.myleb.Brother;

import android.database.Cursor;

import com.example.administrator.myleb.Util.MyApplication;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/2/10.
 */

public class Content {
    String title;
    String desc;
    String time;
    String phone;
    public static List<Content> list1;
    public static List<Content> list2;
    public static MyAdapter myAdapter1;
    public static MyAdapter myAdapter2;
    public Content() {
    }

    public Content(String title, String desc, String time, String phone) {
        this.phone = phone;
        this.time = time;
        this.desc = desc;
        this.title = title;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    private static void MakeItem1(String title, String desc, String time, String phone) {
        Content item = new Content(title, desc, time, phone);
        list1.add(item);}
    public static MyAdapter MakeAdapter1() {/*第一种自己在电脑端手动添加数据到List*/
        list1=new ArrayList<>();
        MakeItem1("安卓新技能get10", "打造listView,GridView,RecyclerView通用的适配器1", "2017-2-171", "100861");
        MakeItem1("安卓新技能get20", "打造listView,GridView,RecyclerView通用的适配器2", "2017-2-17", "10086");
        MakeItem1("安卓新技能get30", "打造listView,GridView,RecyclerView通用的适配器3", "2017-2-17", "10086");
        MakeItem1("安卓新技能get40", "打造listView,GridView,RecyclerView通用的适配器4", "2017-2-17", "10086");
        MakeItem1("安卓新技能get50", "打造listView,GridView,RecyclerView通用的适配器5", "2017-2-17", "10086");
        MakeItem1("安卓新技能get60", "打造listView,GridView,RecyclerView通用的适配器6", "2017-2-17", "10086");
        MakeItem1("安卓新技能get70", "打造listView,GridView,RecyclerView通用的适配器7", "2017-2-17", "10086");
        MakeItem1("安卓新技能get80", "打造listView,GridView,RecyclerView通用的适配器8", "2017-2-17", "10086");
        MakeItem1("安卓新技能get90", "打造listView,GridView,RecyclerView通用的适配器9", "2017-2-17", "10086");
        myAdapter1=new MyAdapter(MyApplication.getContext(),list1);
        return myAdapter1;}


    private static void MakeList(String title, String desc, String time, String phone) {
        Content item =A2_____Db.MakeItem2();/*拿到单个对象，传入list里面*/
        list2.add(item);/*得到list2，传入Adapter构造函数*/
    }
    public static MyAdapter MakeAdapter2(Cursor cursor){/*第二种数据库查询数据得到list*/
        myAdapter2=new MyAdapter(MyApplication.getContext(),list2);/*da*/
        return myAdapter2;/*Adapter加载list2完毕*/
    }
}



